//
//  PSGameInputOptions.m
//  PrefCore
//
//  Created by Sergey on 2/6/14.
//  Copyright (c) 2014 Play-on-smart. All rights reserved.
//

#import "PSGameInputOptions.h"

@interface PSGameInputOptions () {
    PSGameInputFlag flagSet;
}
@end

@implementation PSGameInputOptions

-(instancetype)init {
    if (self = [super init]) {
        [self clear];
    }
    return self;
}

-(void)clear {
    flagSet = 0;
    _hand = 0;
    _score = 0;
    _bid = [PSBid bidNone];
}

-(void)setFlag:(PSGameInputFlag)flag {
    flagSet |= flag;
}

-(void)clearFlag:(PSGameInputFlag)flag {
    flagSet &= ~flag;
}

-(BOOL)checkFlag:(PSGameInputFlag)flag {
    return (flagSet & flag) != 0;
}

-(BOOL)isHumanInputRequired {
    return flagSet != 0;
}

@end
